#coding=utf-8
from  method import *
import unittest
from ddt import ddt,data,unpack,file_data
@ddt
class test_login(unittest.TestCase):
    def setUp(self):
        pass
    # @file_data('add_employee_requests.yaml')
    casedata=[({'password': '000000', 'userNumber': '20280'},200),
          ({'password': '000', 'userNumber': '20280'},1001),
          ({'password': '000000', 'userNumber': '280'},1001),
          ({'password': '00000', 'userNumber': '2280'},1001),
          ]
    @data(*casedata)
    @unpack
    def test_login_01(self,data,check):
        # url = read_yaml('login')['url']
        # headers = read_yaml('login')['headers']
        print(data)
    #     ree = send_requests('login', url, data, headers)
    #     a=ree.text
    #     a1=json.loads(a)
    #     self.assertEqual(check,a1['status'])
    # @file_data('add_employee_requests.yaml')
    # def test_login_02(self,**kwargs):
    #     data=kwargs.get('登录')
    #     print(data)
    #     # ree = send_requests('login', url, data, headers)

    # def test_login_success(self):
    #     url = read_yaml('login')['url']
    #     headers = read_yaml('login')['headers']
    #     data=read_yaml('login')['data']
    #     ree = send_requests('login', url, data, headers)
    #     a = ree.text
    #     a1 = json.loads(a)
    #     token=a1['data']['token']
    #     return token

    def tearDown(self):
        pass

if __name__=="__main__":
    unittest.main()

# a=test_login().test_login_success()
# print(a)






























